#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Range.h>
#include <Common.h>

USING_MOCKCPP_NS USING_TESTNGPP_NS

FIXTURE(Range)
{
    TEST(valid data in "(0,100]" should be true)
    {

        LengthRange range;
        double tstData[] =
        {   0.01,50, 100.005};

        for(int i=0;i<sizeof(tstData)/sizeof(double);i++)
        {
            LengthFloat data(tstData[i]);
            ASSERT_TRUE(range(data));
        }
    }

    TEST(data is out of "(0,100]" should be false)
    {
        LengthRange range;

        double tstData[] =
        {   0.00,100.01};

        for(int i=0;i<sizeof(tstData)/sizeof(double);i++)
        {

            ASSERT_FALSE(range(tstData[i]));
        }
    }

    TEST(valid data in "(0,75)" should be true)
    {
        WidthRange range;

        double tstData[] =
        {   0.01,50,74.999};

        for(int i=0;i<sizeof(tstData)/sizeof(double);i++)
        {
            ASSERT_TRUE(range(tstData[i]));
        }
    }

    TEST(data is out of "(0,75)" should be false)
    {
        WidthRange range;

        double tstData[] =
        {   -1,0.00,75,76};

        for(int i=0;i<sizeof(tstData)/sizeof(double);i++)
        {
            ASSERT_FALSE(range(tstData[i]));
        }
    }
};

